/**
 *  学习目标：Todos 案例
 */
import React from 'react'
export default class App extends React.Component {
  state = {
    count: 1
  }
  render() {
    return (
      <>
        <h4>{this.state.count}</h4>
        <button onClick={this.btnFn}>点击</button>
        <br />
        <Footer></Footer>
      </>
    )
  }
  btnFn = () => {
    this.setState({
      count: this.state.count + 1
    })
  }
}
class Footer extends React.Component {
  render() {
    console.log('footer中的render');
    return (
      <div>
        不改变的footer
      </div>
    )
  }
  // shouldComponentUpdate生命周期返回false时，不更新render，默认返回true
  shouldComponentUpdate(nextProps, nextState) {
    console.log(nextProps, nextState);
    return false
  }
}


